package com.hope.onlinestudy.activity.chanagepass

import android.view.View
import com.hope.onlinestudy.R
import com.hope.onlinestudy.mvp.MVPBaseActivity
import kotlinx.android.synthetic.main.activity_change_pass.*
import kotlinx.android.synthetic.main.view_title.*

/**
 * MVPPlugin
 * 邮箱 784787081@qq.com
 */
class ChanagePassActivity :
    MVPBaseActivity<ChanagePassContract.View, ChanagePassPresenter>(), ChanagePassContract.View,
    View.OnClickListener {
    override fun getLayoutView(): Int {
        return R.layout.activity_change_pass
    }

    override fun onClick(v: View?) {
        when (v?.id) {
            R.id.iv_backup -> finish()
            R.id.btnChangePass -> {
                val oldPass = etOldPass.text.toString()
                val newPass = etNewPass.text.toString()
                val subPass = etSurePass.text.toString()
                mPresenter?.changepass(oldPass,newPass,subPass)
            }
        }
    }

    override fun initData() {
        tv_title.text = "修改密码"
        iv_backup.setOnClickListener(this)
    }
}